package com.aiyige.utils.widget;

import android.support.v4.app.DialogFragment;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.Window;

import com.aiyige.R;

/**
 * Created by zhuyakun on 2017/11/6.
 */

public abstract class BaseBottomDialogFragment extends DialogFragment {

    public BaseBottomDialogFragment() {
        setStyle(STYLE_NORMAL, R.style.BottomDialogTheme);
    }

    @Override
    public void onResume() {
        super.onResume();
        Window window = getDialog().getWindow();
        if (window != null) {
            window.setGravity(Gravity.BOTTOM);
            window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        }
    }

}
